home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / PASCALL / VIDEO / KEP.PAS < prev    next >
Pascal/Delphi Source File  |  1993-06-16  |  591b  |  28 lines

  1. {$M $800,0,0 }   { 2K stack, no heap }
  2. { This program causes a click each time
  3.  a key is pressed.}
  4. uses Crt, Dos;
  5. var
  6.   KbdIntVec : Procedure;
  7. {$F+}
  8. procedure Keyclick; interrupt;
  9. begin
  10.   if Port[$60] < $80 then
  11.     { Only click when key is pressed }
  12.     begin
  13.     Sound(5000);
  14.     Delay(1);
  15.     Nosound;
  16.     end;
  17.   inline ($9C); { PUSHF -- Push flags }
  18.   { Call old ISR using saved vector }
  19.   KbdIntVec;
  20. end;
  21. {$F-}
  22. begin
  23.   { Insert ISR into keyboard chain }
  24.   GetIntVec($9,@KbdIntVec);
  25.   SetIntVec($9,Addr(Keyclick));
  26.   Keep(0); { Terminate, stay resident }
  27. end.
  28.